package grxm0;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.Scanner;



public class demo {

	public static void main(String[] args) {
		  int num =(int) (Math.random()*100);
		  System.out.print("答案"+num);
		  System.out.println("请输入猜的数字（1-100）");
		  
	        System.out.print("请输入数字 退出游戏按0");
	       
	        Scanner scanner =new Scanner(System.in);
	        int guest=scanner.nextInt();
	      
	        	for(int i=0;i<8;i++) {
	        		if (guest ==0) {
					break;
				}else if(guest>num) {
					System.out.println("太大了");
				}else if(guest>num) {
					System.out.println("太小了");
				}
	        	System.out.println("请输入你猜的数 退出游戏按0");
	        	guest =scanner.nextInt();
	        	}
	        	
	        
	        if (guest==num) {
	        	System.out.println("猜对了");
				
			}else {
				System.out.println("真遗憾");
			}
	        scanner.close();
	
	       
	}
	}
